<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<script type="text/javascript">
                           $(document).ready(function(){
								$('.treeview').treeview();
								//$('.treeview li a').after('<span title="添加子节点" class="addnode"><a href="javascript:alert(1);">添加子节点</a></span><span title="编辑该节点" class="editnode"><a href="javascript:alert(2);">编辑该节点</a></span><span title="删除该节点" class="delnode"><a href="javascript:alert(3);">删除该节点</a></span>');
								$('.treeview li span').hide();
								$('.treeview li').hover(function(){
									$(this).children('span').show();
								},function(){
									$(this).children('span').hide();
								});
							});

								</script> 
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="8" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="11" /></jsp:include> 
<form action="" id="frmMessage" name="frmMessage"></form>
    <section id="container">
    <%
    //---------分页
    int currentPage=1;
    if(request.getParameter("Page")!=null)
    {
    	currentPage=Integer.parseInt(request.getParameter("Page"));
    }
  	String result = session.getAttribute("result").toString();
    %>
    <div id="crumbs">
        	积分管理 &raquo; 积分列表
    </div>
    <!-- <div id="deleteContent"></div> -->
        <div id="main">
        	<div class="tabs">
                <ul class="tabs-nav clearfix">
                    <li>答题上行积分</li>
                    <li>点播上行积分</li>
                </ul>
                
                
                
                <div class="tabs-panel">
                  <%
                    StringBuffer sb = (StringBuffer)session.getAttribute("sb");
                  %>
               <table width="100%" class="datalist">
					<tr>
						<td>

							<ul class="treeview" id="headerIndex">
								<%=sb %>
							</ul>
					</td>
					</tr></table>
                </div>   
                <div class="tabs-panel">
<%
				if(!result.equals("")){
					out.println("<script>alert('"+result+"');</script>");
					session.removeAttribute("result");
				}
	            int colSpanNum=11;
%>
                	<table width="100%" class="datalist">
                    	<thead>
                    	    <tr><td><input type="button" name="addType" id = "addType" value="新建类型" onclick="$mb=$.msgbox({
                    	        height:400,
                    	        width:500,
                    	        content:{type:'ajax', content:'jifen/addDianboType.jsp'},
                    	        title: '新增点播类型'
                    	    });"/>
                    	    </td><td colspan="5"></td></tr>
                        	<tr>
                            	<td class="tc">
                            	    <input type="checkbox" name="ckUsers" id="ckUsers" onClick="selectAll('ckUsers');"  />
                            	</td>
                            	<td class="tc">类型</td>
                            	<td class="tc">分数</td>
                            	<td class="tc">创建时间</td>
                            	<td class="tc">设置</td>
                            	<td class="tc">操作</td>
                            </tr>
                        </thead>
                           <%
                            List<DianboType> dianboTypeList = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
                            if(dianboTypeList!=null&&dianboTypeList.size()>0){
                            	for(DianboType dianboType:dianboTypeList){
                            		%>
                            		<tr>
                        	<td class="tc"><input type="checkbox" name="ckUsers" id="<%=dianboType.getTypeId() %>" value="<%=dianboType.getTypeId()%>"/></td>
                        	<td class="tc">
                        	 <%=dianboType.getTypeName() %>
                        	</td>
                        	<td class="tc">
                        	 <%
                        	 String condition = " typeId='"+dianboType.getTypeId()+"' and integralType=0";
                        	 JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
                        	 if(jiFen!=null){
                        		 %>
                        		 <%=jiFen.getIntegralValue() %>
                        		 <%
                        	 }
							 %>
                        	</td>
                        	<td class="tc">
                        	 <%=dianboType.getCreateTime() %>
                        	</td>
                        	<td class="tc"style="cursor:hand"><a style="cursor:hand" onclick="msg=$.msgbox({
        height:400,
        width:500,
        content:{type:'iframe', content:'./DianboServlet?method=set&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
        title: '点播积分设置'
    });">设置</a></td>
    <td class="tc"><a style="cursor:hand" onclick="msg=$.msgbox({
        height:400,
        width:500,
        content:{type:'ajax', content:'./DianboTypeServlet?method=modifyType&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
        title: '修改类型'
    });" title="修改该类型" class="msg_open">修改</a> <a style="cursor:hand" onclick="delDianboType('../DianboTypeServlet?method=del&dianboTypeId=<%=dianboType.getTypeId() %>')" title="删除该消息" class="msg_del">删除</a></td>
                        	</tr>
                            		<%
                            	}
                            }
                           %>
                        	
                    </table>
                </div>   
                <div class="tabs-panel">
                aaaaaaaaaaaa
                </div>     
        	</div>
        </div>
  </section>
  <jsp:include page="../foot.jsp"></jsp:include>
  </div>
</body>
</html>
